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 / Update SharePoint - bl...
Power Automate
Unanswered

Update SharePoint - blank fields from Forms

(0) ShareShare
ReportReport
Posted on by

I use Forms for employees to record the number of improvements each month. When they fill out the form, they must first select the correct position and then select the month they wish to apply for. Each month has an answer field in the form.
This means that every time a response is submitted, there are 11 empty fields.

 

In the SharePoint list, I only want the field with content from Forms to populate the list, and that empty fields from Forms remain as they are in the SharePoint list. Now the value is set to zero in all fields that have no data, and only one month gets data.

 

I reckon there's an easy fix for that. I know whats causing the problem, but I can't get it right. I've tried the If empty formula, but can't quite get it to work. Can someone show me? Thanks!

 

trndlnd_2-1693568672755.png

 

The SharePoint list

trndlnd_1-1693568616218.png

 

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    Hi @trndlnd 
    How did you design your Form? The more context you share, the faster you will get a useful response
    Thanx!

  • trndlnd Profile Picture
    on at

    This is the form.

     

    1. Pick your department

    2. Pick month to register 

    3.-14.: The number of improvements for the selected month. 

     

    I've used branching from field 2. to field 3. - 14 so that you can only record one month for each registration.

     

    trndlnd_0-1693569908838.png

     

     

  • efialttes Profile Picture
    14,756 on at

    Hi again!
    So there is a question on the top of type choice, 12 possible values and...once the month is selected, just one of the questions 3-14 is shown due to branching rules, right? 

     

     



    efialttes_1-1693585163499.png

    And all 3-14 questions are of type text, right?
    efialttes_2-1693585232810.png
    If above assumptions are correct, I have made a test by selecting 'February' from a list of 3 months, and the respose body is as follows, i.e. responses for 'January' and 'february' are empty strings

    efialttes_4-1693585600623.png

    I need some more minutes to build a test SP list, I will let you know soon the result

     


    ....

  • efialttes Profile Picture
    14,756 on at

    Hi again!
    One more question... you mention that 'I only want the field with content from Forms to populate the list, and that empty fields from Forms remain as they are in the SharePoint list. Now the value is set to zero in all fields that have no data, and only one month gets data.'

    You mean you have one SP item per employee, and when updating a SP item, you do not want to delete already existing values in previous months, right?
    So for example, an employee is filling the report for Febreuary, and some time ago he already filled values for January:

    efialttes_5-1693586716732.png

    And you wanna keep old January value, and just add new February value right?

    efialttes_6-1693588201690.png

     


    If so, I would do the following:




    Now, I am identifying empty answers as you mention by means of empty() WDL function. What I am doing is to 'Get item' first and use Month output value to update the item if that Month's empty in the form. In order to understand WDL expressions better, I am storing each Month Forms response in a variable with the same Month Name:

    efialttes_7-1693588605753.png

     

    Next, I am reading current SP item content for the emploee that provided a new answer, and I am using the following WDL expressions to update 'January', 'February', 'March' on 'Update item':

     

     

    if(empty(variables('January')),outputs('Get_item')?['body/January'],variables('January'))
    
    if(empty(variables('February')),outputs('Get_item')?['body/February'],variables('February'))
    
    ...

     

     


    So my test flow looks as follows:

    efialttes_2-1693910231398.png

     

     


    Hope this helps



  • trndlnd Profile Picture
    on at

    Thanks for your reply @efialttes ! I really appreciate it!

    You are completely right about how I want the flow to work.

     

    I've tried to copy your example, but it still doesn't work as it should. I've probably missed some steps..

     

    I've stored each Month Forms response in a variable with the same Month Name.

    I didn't understand what's inside the "Initialize variable ID" action so maybe here is where the problem is.

     

    Can you show me the whole flow?

     

    I realize i did not mention I have a condition to identify the right Item in the SP-list. Don't think this is why it is failing..?

    trndlnd_0-1693814194885.png

     

     

     

  • efialttes Profile Picture
    14,756 on at

    Hi @trndlnd !
    In my test flow, I declare "Initialize variable ID" variable of type Integer but do not assign yet a value, then I am searching for the matching SP item and store its ID in "ID" variable by means of several steps hidden inside the 'Scope get SP item' action block, finally I use the ID variable content in 'Get item' and 'Update item'. 

    efialttes_0-1693909909208.png


    Sorry I did not add a complete image from my test flow in my last post, I have updated it, you can also find it here:

    efialttes_1-1693910191083.png

     

    :

    Hope this helps


  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi again!
    I have replicated your flow design, so I guess you are using a 'Get items', then the 'Apply to each' iterates through all of the items, and if the condition itself is met, you update the item.
    If so, you can forget about Id variable, keep your current design (do not add 'get item' action block) and use the following expressions to update columns:

     

     

    if(empty(variables('January')),item()?['January'],variables('January'))
    
    if(empty(variables('February')),item()?['February'],variables('February'))
    
    ...

     

     


    Overall design look like this:

    efialttes_3-1693911228184.png

    Apply to each content looks like this:

    efialttes_4-1693911305281.png

    Hope this helps


    There are other ways to implement a more efficient flow, but if your SP list have just a few items, it should work fine.

  • trndlnd Profile Picture
    on at

    Thank you for your help, @efialttes !

     

    It works fine now. The SP-list has 21 items and it seems to work fine with that amount of items.

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard