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 / Dynamically update val...
Power Automate
Suggested Answer

Dynamically update values of newly created columns in SP

(1) ShareShare
ReportReport
Posted on by 32
Hello,
 
I have 2 sharepoint lists, lets call them SP1 and SP2. Once every few months i need to remove all information from SP1 and populate it with info from SP2.
 
The issue- there are columns added through HTTP requests to both SP (at every point in time both SP should have identical columns) and value populated for those columns.
 
My question is, how can i dynamically populate this value for the new columns  using power automate.
 
Example i have 3 columns(A B and C) in both lists. During a period column D is added, how can i dynamically take its value from SP2 and pass it to SP1 with a create item action for example.
Or maybe i utilize some other method
 
thank you in advance!
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    I hope this idea may works 
     
    Also i think your flow design is kind of manual trigger or scheduled flow rather than a event trigger as you want to do when yours items in SP List 1 is empty.
     
    See the flow design below.
     
    There are different sections for this
     
    Section 1- get the columns names from SP List.
     
    1. use initialize variable to initialize list of column names which would be default column names in SP list 
    I hope these are default columns and assume that you don't need to update the attachments here.
     
    2. Use initialize variable to initialize a Json object which is empty as shown below

     
    3. Use send http request to get list of column details which are not hidden and not read-only.
    API format- /_api/web/lists/getbytitle('provide list name here')/fields?$filter=Hidden eq false and ReadOnlyField eq false
     
    4. Filter out the columns details from body of API response which are default columns
    Expression used- 
    body('Send_an_HTTP_request_to_SharePoint')?['d/results']
     
    5. Select the columns from output of filter array using select action.
     
     
     
    Section 2- Create items in SP List
     
    6. Get items from SPList2 as shown below
     
    7. Iterate through each item from get items action using apply to each.
    Next steps will be in apply to each loop
     
    7.1- use another apply to each which will loop through each item present in select action's output.
     
    7.1.1- use compose action which helps to add a property to the ColumnDetails json object variable.
    Expression - 
    addProperty(variables('ColumnDetails'),items('Apply_to_each_2'),items('Apply_to_each')?[items('Apply_to_each_2')])
     
    7.1.2- use set variable to set the value with output of compose action.
     
    7.2. Create item in SP1 using create item. Here pass the name of list as variable select the dropdown of list name field, selecting enter custom value and then pass variable where you have stored the list name, then you will see Items field where the item details to be created can be passed as object.see below
     
    7.3. reset the columndetails variable to empty json object
     
     
    Try this approach - see whether this works !
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,429 Super User 2025 Season 2 on at
    Hi 
     
    So Nived's answer works well I am only going to add one suggestion to that.
     
    Instead of hard coding the Values, create an Environment Variable in your solution. If your Flows are NOT solution aware, please make them.
     
    This way you just update the Environment Variable with the new list of Columns when it changes and done.
    That or you create a SharePoint List (with configuration values only in it Key/Value columns
     
    Have one Key be Dynamic Columns
    Have the Value be the list of columns in an array
     
    Then in your flow where you add Columns via HTTP, you can update that value automatically to have the new Column Name(s) and then read this back 
    to enable you to populate list b/2
     
     
     
     
     
  • MMDDW Profile Picture
    32 on at
    Hi Nived,
     
    thank you for the thorough explanation.
     
    This looks like just what i need. Will test it over the weekend and confirm the results afterwards!
     
    br
    Martin
  • lbendlin Profile Picture
    8,479 Super User 2025 Season 2 on at
    Remember that when you create a new item in sharepoint it requires a brief cooldown period to exchange the temporary ID for the final item ID.  If you try to modify the item too quickly you may not find it yet.  Of course you could include the modifications already in the creation of the new item?
  • CU16081827-0 Profile Picture
    on at

    Whatapp: + 12108028327. ACHETEZ DE LA FAUSSE MONNAIE INDÉTECTABLE EURO EN LIGNE. Télégramme: poka_lauren2 

    Êtes-vous fatigué de vivre chèque de paie à chèque de paie, luttant pour joindre les deux bouts? Vous êtes-vous déjà demandé s'il y avait un moyen d'améliorer votre situation financière? Ne cherchez pas plus loin! Dans cette annonce, nous explorerons une solution non conventionnelle mais efficace à vos problèmes financiers. Nous avons également des livres STERLING, USD, CAD AED, DINAR et de nombreuses autres devises.

    Achetez des faux billets en euros indétectables en ligne. Avec une qualité et une authenticité à 100%, nos billets contrefaits sont la clé pour libérer la liberté financière. 

    Achetez des faux billets en euros indétectables en ligne.

    Acheter des billets contrefaits 

    où acheter de faux billets en euros en ligne 

    où acheter des faux billets en ligne 

    où acheter de fausses factures en ligne

     

    acheter des billets contrefaits en ligne

     

    où acheter de faux billets en ligne

    où puis-je acheter de faux billets en euros?

  • MMDDW Profile Picture
    32 on at
    Hi Nived,
     
    your solution worked like a charm, thank you!! (for some reason i cannot mark your answer as the solution, but i consider it as such). 
     
    I just did a couple of tweaks so it applied to my situation.
    1. Had to change the uri for the http GET request, so that it takes the InternalName of the column instead of the DisplayName (for some reason they were different) and ended up with this - /_api/web/lists/getbytitle('<my list>')/fields?$select=InternalName,Title&$filter=Hidden eq false and ReadOnlyField eq false
    2. Used the SetProperty instead of addProperty, as after the first iteration i receive the below error:
     'The template language function 'addProperty' expects the property to not exist in the object.
     
     
    not sure if its because for the second iteration the ColumnDetails variable already has properties.
     
    In any case. thanks again
    regards
     
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    Good to know that my idea works for you :)
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. 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 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