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 / Error moving Form answ...
Power Automate
Unanswered

Error moving Form answers to SharePoint List

(0) ShareShare
ReportReport
Posted on by 9

I have built a form that collects several items and uses branching to bypass secondary questions if you say No to the primary question. For example:

 

Do you want Item#1 (Yes No)

If Yes

Start Date (using the built in picker for all of these date field)

End Date

 

If you choose no it skips to the next primary question

 

Do you want Item#2 (Yes No)

If Yes

Start Date

End Date

 

Form completed.

 

If the user selects "No" to Item#1 the start date and end date skipped. Using the Create Item for SharePoint action I have added IF statements when retrieving the the start dates and end dates to set the date as NULL if the field is empty. here is the formula

 

if(equals(outputs('Get_response_details')?['body/GUIDBlahBlah'],''),null,formatDateTime(outputs('Get_response_details')?['body/GUIDBlahBlah']))

 

When I run a test I get the following error.

 

Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string 'No' was not valid. The datetime string must match ISO 8601 format.'.

 

Any assistance would be great.

Categories:
I have the same question (0)
  • Craig Stewart ABZ Profile Picture
    959 Super User 2024 Season 1 on at

    Hi 

     

    You need to add the format to this. I think the below will fix it.

     

    if(equals(outputs('Get_response_details')?['body/GUIDBlahBlah'],''),null,formatDateTime(outputs('Get_response_details')?['body/GUIDBlahBlah'],'yyyy-MM-dd'))

     

    ** Sorry I just reread your post so ignore this, I'll go have a think about this **

     

  • Gfickel Profile Picture
    9 on at

    Thanks CriagStewart for looking into this.

  • Verified answer
    Craig Stewart ABZ Profile Picture
    959 Super User 2024 Season 1 on at

    Ok

     

    So it looks like your response id is incorrect in your expression - you're picking up the response id from the YES/NO option

     

    I was able to recreate the error by doing exactly that. You'll need to identify the correct id and then your expression should be:

     

    if(empty(outputs('Get_response_details')?['body/r1e2754a5cc824a1082d6aaefc21ad0ff']),null,outputs('Get_response_details')?['body/r1e2754a5cc824a1082d6aaefc21ad0ff'])

     

    If you're not seeing the Start and End Date as response detail options in Power Automate, you can workaround like I did by selecting it in another section then copy and pasting into to notepad to get the details:

    Here we see no option:

    CraigStewart_8-1653129791169.png

     

    If we click in another section we do get a list.

    CraigStewart_9-1653129823103.png

    click and copy then paste into notepad

     

    CraigStewart_10-1653129901695.png

     

     

    SharePoint list column is set up as Date and time

    CraigStewart_0-1653129366078.png

     

    Start and End Date using the same style of expression

    CraigStewart_7-1653129767992.png

    if(empty(outputs('Get_response_details')?['body/r1e2754a5cc824a1082d6aaefc21ad0ff']),null,outputs('Get_response_details')?['body/r1e2754a5cc824a1082d6aaefc21ad0ff'])

     

    3 form responses with the date filled in

    1 response where we selected NO to the first question and therefore skipped the dates

    CraigStewart_2-1653129470022.png

     

     

    CraigStewart_3-1653129535408.png

    CraigStewart_4-1653129553071.png

    When we select Yes we get the options

    CraigStewart_5-1653129580867.png

     

    Hope that helps.

     

    Craig

  • Gfickel Profile Picture
    9 on at

    This was just what I needed thank you!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard