web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Validation Parse JSON ...
Power Automate
Answered

Validation Parse JSON Values

(1) ShareShare
ReportReport
Posted on by 79

Hi Community,

 

Hope you can help. I have parsed a CSV using the TachyTelic approach. How to Parse a CSV in Microsoft Power Automate

 

I started with the Create a file in File System when a new email arrives in a shared mailbox template. Inside the condition is an Apply to Each. 

 

I need to be able to add some validation to the returned values. For example I need to ensure the length of SAPAgentNo is 6 characters. I guess the approach would be to put the output into an array but the problem is I am inside an Apply to Each so I cannot Initialize a Variable. How can I validate the value in my Parse JSON array  

 

THANKS

 

ParseJSON.png

 

 

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @DDM 

     

    Yes you can't put initialise inside the apply to each loop. What you need to do is add an action step initialise variable before the Parse JSON Step. Then after the parse JSON step you need to add action step 'Set Variable' and map the Dynamic value from the previous parse JSON step.

     

    Another way you could do is add a compose statement after the parse JSON step. Map the Dynamic value. Then next step add another compose and set an expression called length(). Here map the previous output of the compose. 

     

    Thanks

  • DDM Profile Picture
    79 on at

    Many Thanks @abm 

     

    So i have gone for the second approach and am able to return the value length. So far so good, but I need to perform and action. For example : Send an e-mail if the value length is less than the required length. 

     

    Can you guide me on how I would achieve that ?

     

    If expression using my compose would work right ?

     

    Thanks

     

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @DDM 

     

    Add an IF action step and check the output of the length. See below.

     

     

    image.png

  • DDM Profile Picture
    79 on at

    @abm 

    Perfect!

    Thank You.

  • TediBear Profile Picture
    11 on at

    Hello Community!

     

    My values stopped working since couple of days ago. Please help! Thank you in advance.

    n

    TediBear_0-1676557634199.png

    TediBear_1-1676557672567.png

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @TediBear 

     

    From the above given error the schema was expecting an array of string values. Now it is getting integer value. Check the previous step of Parse JSON where you passing from Flow run history. Compare the old successful run record vs the current failure. You could see there are differences in data. Its a data issue.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard