Skip to main content

Notifications

Community site session details

Community site session details

Session Id : pt1CNC+BjtbaqWyj10QaN9
Power Automate - Building Flows
Answered

Validation Parse JSON Values

Like (1) ShareShare
ReportReport
Posted on 29 Jan 2023 20:27:39 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

 

 

 

  • abm abm Profile Picture
    32,464 Most Valuable Professional on 16 Feb 2023 at 17:01:40
    Re: Error received using Parse JSON Values

    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

  • TediBear Profile Picture
    11 on 16 Feb 2023 at 14:29:31
    Re: Error received using Parse JSON Values

    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

     

  • DDM Profile Picture
    79 on 29 Jan 2023 at 22:01:45
    Re: Validation Parse JSON Values

    @abm 

    Perfect!

    Thank You.

  • Verified answer
    abm abm Profile Picture
    32,464 Most Valuable Professional on 29 Jan 2023 at 21:52:15
    Re: Validation Parse JSON Values

    Hi @DDM 

     

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

     

     

    image.png

  • DDM Profile Picture
    79 on 29 Jan 2023 at 21:35:34
    Re: Validation Parse JSON Values

    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

     

  • abm abm Profile Picture
    32,464 Most Valuable Professional on 29 Jan 2023 at 20:53:02
    Re: Validation Parse JSON Values

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 97

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard