Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Updating missing fields from list A using list B as the source.

Posted on by 2
Background: I am attempting to update list A using information from list B. The problem is, the field I want to use to create the lookup from list A and list B are not a 1:1 match. For example, List A contains "FUND1 - Draft 1" but list B contains "FUND1" in the field I am attempting to make the link between the two lists. The field I want to populate in List A using List B is the "Strategy Code." To clarify, List A "Strategy Code" is currently empty while List B has this field populated.
 
The Ask: Can someone help me create a solution that would be able to update List A's "Strategy Code" field using a function that links the two list with some sort of "Contains" function in it to get around the problem of not having a 1:1 match between the identifiers?
  • David_MA Profile Picture
    David_MA 7,582 on at
    Updating missing fields from list A using list B as the source.
    With all the spam messages, I accidentally tagged this as spam when I meant to tag the message above it. My apologies. I reached out to the admins to tell them not to process the spam request, but they don't seem to be monitoring the private channel for those posts. 
     
    I hope they get the spam under control soon!
     
    Best regards,
    David
  • Johnny Bravo Profile Picture
    Johnny Bravo 2 on at
    Updating missing fields from list A using list B as the source.
    Hey Thank you very much for your response. I actually got it to work and I am coming across another issue related to which comes first "Fund1" or "Fund1 - Draft 1." 
     
    My current flow is triggered once an item is created in List A. Once triggered the flow will get Items from List B and then proceeds to apply a condition "to each" from the get items. The condition is looking for "Fund1" from List B in List A which contains the format of "Fund1 - Draft 1."  To clarify, List A contains the "Fund1 - Draft 1" structure and List B contains the "Fund1" Structure. Additionally, List A structure comes first since this is the list that is the source of the trigger.
     
    The Issue:
    Everything works and is correctly applying the strategy as intended but I believe the firm is currently using a free version of power automate. So with this constraint I am forced to reduce the performance intensity of the flow. I attempted to do this through the filterquery however, this is where the order of things is messing with my solution. I need the query to filter based on "Fund1" naming convention from List B in List A's structure of "Fund1 - Draft 1." I believe the issue is that I can only query List B Get Items using List A naming convention which is a problem since List A is the naming convention with the Draft information in it so it will not find a match.
     
    Would you possibly be able to help me with this? Let me know if I need to clarify anything or provide snips of the flow.
  • Suggested answer
    FLMike Profile Picture
    FLMike 29,366 on at
    Updating missing fields from list A using list B as the source.
    Hi
     
    Your explanation is perfect, however something is missing. I don't know what Table you have the information for. What I mean is, in your Flow, does it know about ListA first??? or ListB first???
     
    A.K.A. do you have the term FUND1 or do you have the term FUND1 - Draft 1 first? The order matters in how I answer.
     
    Let's say that you have FUND1 (by itself first).
     
    You would do
     
    1. Get Items , on ListB, with a Filter expression of MyColumn eq 'FUND1' and if you column name has spaces use [My Column] eq 'FUND1'
    2. Add a Condition action
    In the left put the expression length(AndInHerePutTheDynamicPropertyBody/Value from Step 1)
    in the middle put equals
    in the right 1
     
    This will verify you only got the 1 record.
     
    3. I know this may seem silly but add an Apply to Each in the Yes side
     
    4. In the Apply to Each, rename it to ListB Item (just like that)
    5. Inside the 'ListB Item' loop put
     
    Get Items, for ListA and the filter would be [My Column] 
    In the filter we CANNOT use Contains, we need to use substringof
     
    so it looks like this
    substringof(ListAColumnToCheckGoesHere, 'InsertTheDynamicPropertyInListBThatHasTheFUND1value')
    
    
    Now once again we need to validate that you received a row so
    Put a Condition check right under the GetItems
    Left side put the expression length(PutDynamicBody/ValueFromtheListAGetItems)
    middle equals
    right 1
     
    Note: we could have skipped using Apply to each's but this is easier to type up than typing long paths to data
     
    In the Yes side, we want to update ListA so put an Apply to Each (yes I know its silly but please do)
    Now, we only expect to have 1 row to update as only (hopefully) only 1 row matches the Filter
     
    Add an UpdateItem SharePoint action
     
    in the ID put the Dynamic ID Property from your listA get items
    populate any required fields. You do so by simply putting in the Matching Dynamic ListA property from the Get Items
    In the ONE column you want updated (Strategy)
    -- You would put the Dynamic Strategy Property, from the original ListB Get Items
     
    and you are done :-)

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,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard