Hi Folks,
Goal: I am trying to fetch Primary Contact details, dynamic array of JSON, of active users using a data action. For that, I added EmailAddress, Names as Array of String Output Contracts and PrimaryContacts as Array of JSON array, to fetch the dynamic array of JSON objects for each contact. It will help me to get and navigate Primary Contacts easily for each user. Because, I don't have exact count of the Primary contacts for each user. I thought if I get the list of JSON array then easily with JSON parsing I can get my required parameter values inside flow.
Result: When I am running the Data Action with unchecked the Flatten, I can see Username, EmailAddresse(Attached) as expected but PrimaryContactDetails are blank array(Attached). But, in execution and output transformation step it shows as a List of JSON array. Actually, the Primary contacts are dynamic, a JSON array, are not showing in result display(Attached). As, it was not giving me any error in Data Action, I thought to fetch the list in Architect if possible. Now, In Architect when I tried to use the Data action it's showing me an error attached.
Doubts:
Q1. Is there any way to resolve the List of Array of JSON in architect? Looks like no, still confirming from you all?
Q2. Is the Image of showing Array of array of JSON in Data Action is right? If yes, then why the values are not showing?
Ask for Solutions:
Now, suggest me the best way to get the dynamic array of JSON for each user's and fetch each parameters.
My thought to Fetch the user names and Full JSON List of all users in a JSON Collection using Data Action. Then, inside the flow using a loop I will get the index of each user and with the index I will fetch the JSON array of the Primary Contacts. After that through a loop, I need to parse each primary contact JSON objects from the list.
Example JSON for a user:
{
"id": "86cfb79b-53dc-4e2b-9fae-e7a4ce8c4458",
"name": "Subhajit Podder",
"division": {
"id": "7d2f53dc-24fa-4d89-9b03-b6621efa39ef",
"name": "Home",
"selfUri": "/api/v2/authorization/divisions/7d2f53dc-24fa-4d89-9b03-b6621efa39ef"
},
"email": "subhajit.podder@Test.com",
"primaryContactInfo": [
{
"address": "subhajit.podder@Test.com",
"mediaType": "EMAIL",
"type": "PRIMARY"
},
{
"display": "(82408 66281)",
"mediaType": "PHONE",
"type": "PRIMARY"
},
{
"display": "(82408 6111)",
"mediaType": "SMS",
"type": "PRIMARY"
}
],
"addresses": [
{
"address": "Test@gmail.com",
"mediaType": "EMAIL",
"type": "WORK"
},
{
"display": "(82408 33381)",
"mediaType": "SMS",
"type": "WORK",
"countryCode": "US"
},
{
"display": "(98755 16968)",
"mediaType": "SMS",
"type": "WORK2",
"countryCode": "US"
},
{
"display": "(82408 6111)",
"mediaType": "SMS",
"type": "WORK3",
"countryCode": "US"
}
],
"state": "active",
"username": "subhajit.podder@Test.com",
"version": 51,
"preferredName": "Subhajit P",
Document Attached:
Data Action Export, Screenshot of UserName and Email Fetch Showing Properly in Data Action, Screenshot of Primary Contacts Not Showing Properly in Data Action, Error Screenshot in Architect to use the Data Action.
#Architect#DataActions------------------------------
Subhajit Podder
NA
------------------------------