Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Microsoft form to SharePoint blank choice columns

Posted on by 69
Hi team,
 
I have a simple flow where the response from a MS Form is created in a SharePoint list.    The form has some branching means some Yes/No questions won't appear to the end user.
 
I was trying to account for that by looking at empty values and sending across a null value to the single choice field but it still populates a value of "No" despite the column being set to no default value and for the column to not require information within it. 
 
if(empty(outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e']),null,outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e'])
 
 
Any support would be most welcome :)
 
Thanks
smods
  • Suggested answer
    David_MA Profile Picture
    David_MA 7,541 on at
    Microsoft form to SharePoint blank choice columns
    Since you don't show your form or flow, I am not sure of what you are exactly doing. I assume you have a question such as this:
    I used the two coalesce expressions on this and it didn't error. I tried returning "Not Answered" when it was not answered. The flow still didn't error, but it also didn't return "Not Answered" so that tells me something is being returned from the question even though it is not answered..
     
    So, I combined if and coalesce to return a value and that worked. Try the following:
     
    coalesce(if(equals(outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e'], ''), null, outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e']), 'Not Answered')
     
    I am heading to Europe for two weeks, so if this doesn't work, hopefully someone else will have a solution or you'll figure something out. Good luck.
  • smodkins Profile Picture
    smodkins 69 on at
    Microsoft form to SharePoint blank choice columns
    Hi David,
     
    Thank you for coming back to me.  I tried both and the same thing happened.... I have the expression directly within the 'Create Item' field so it maps to the relevant column in the SharePoint list.
     
    Looking at the flow I do believe it's the SharePoint causing the issue as the input on the Create Item correctly shows no input value.  Turns out the column formatting in SharePoint was causing the issue, resetting it to default worked with the second expression you provided, Thank You! 
     
    Can this function be used to return a No value and if so, how?
     
    Thanks
    C
     
     
  • Suggested answer
    David_MA Profile Picture
    David_MA 7,541 on at
    Microsoft form to SharePoint blank choice columns
    Try using the coalesce expression instead it is a lot simpler: coalesce(outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e'], null)
     
    If that doesn't work, try coalesce(outputs('Get_response_details')?['body/r1e478abddb9240a18ad7d7072ff5696e'], '')
     
    The key difference is in the fallback value. The first expression returns null if the value is empty. The second expression returns an empty string if the value is empty. Depending on how you want to handle the empty case in your workflow, you can choose the appropriate expression. If you need to distinguish between a null value and an empty string, this difference is important.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard