Hi All,
How can I get the “LatestPublishedVersionId” from below JSON. I have done by using for each loop but its returning Null
Hi All,
How can I get the “LatestPublishedVersionId” from below JSON. I have done by using for each loop but its returning Null
→ Use the Deserialize JSon activity and give the string datatype variable as Input let call the Input variable name as JsobInput.
→ Create a output variable in the Deserialize JSon activity in the JsonObject field in properties, the output datatype is jsonObject datatype, let’s call the variable name as JsonObject.
→ Then use the assign activity to store the LatestPublishedVersionId in a String Variable.
- Assign -> Output = JsonObject("records")(0)("ContentDocument")("LatestPublishedVersionId").ToString()
Check the below workflow for better understanding,
Hope it helps!!
why after records (0) is there
Okay @dutta.marina
The (0) after records is used to access the first element of the records array in the JSON data. In the provided JSON structure, records is an array containing one or more objects. By using (0), we are selecting the first object in that array to access its properties.
Hope you understand!!
Because of Record is a JArray and LatestPublishedVersionId is fetched from first item
same as mentioned in the other topic:
[ - starts a JArray
{ - starts a JObject
Okay @dutta.marina
The attributes key typically contains metadata about the object it is part of. Which starts its Json Object and we use Curly braces Json Object.
and The records key is used to denote a collection or an array of items and we use square braces for Json Array
Hope you understand!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.