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 Apps / Patching using a colle...
Power Apps
Unanswered

Patching using a collection separated by commas?

(0) ShareShare
ReportReport
Posted on by 14

I am running a collection that is pulling a list of tags separated by commas from a database. I have a button in my PowerApp that I would like to run the following onselection:

1) run the collection

2) patch that column with the existing tags (that are separated by commas) plus one additional tag that I would like it to add to the list.

 

My code currently looks like this: 

 

ClearCollect(Tags,LookUp(Active,ID = DataTable2_2.Selected.projectid).psa_tags);  (this is to pull the correct tags based on ID)

 

ClearCollect(UpdatedTags, LaunchTags, ",Awareness");    (here im trying to add an 'Awareness' tag to the list of existing tags

 

Patch(
    Activities
    LookUp(
        'Activities',
        id = AssignItem.id
    ),
    {psa_tags: UpdatedTags}
)

 

 

My issue is that the Patch function is running an error, this is because the UpdatedTags collection isnt collecting as a string. Its collecting as an object plus my text entry. Is there a way to collect the tags from the DB, add my tag to the string with an additional comma, and patch the column with my tag added?

 

Thanks for the help!

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @broski1212 ,

    If I am reading your requirements correctly, you want to

    • Get the tags of an existing record
    • Add , Awareness to them
    • Patch them back updated

    Try this

    UpdateIf(
     Activities
     LookUp(
     'Activities',
     id = AssignItem.id
     ),
     {psa_tags: psa_tags & ", Awareness"}
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • broski1212 Profile Picture
    14 on at

    Hey @WarrenBelz 

     

    Thanks for the help. This code ran me an "Invalid argument type (record). Expected boolean value instead" & "The function UpdateIf has some invalid arguments"

     

    Ive never used the updateif function before. Its looking like the fact that the existing tags record is returning a record as opposed to a string might be the issue? Would really appreciate some guidance here.

     

    Thanks!  

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @broski1212 ,

    I actually tested the syntax on a test list with numeric identifiers and a Multiple Lines of Text field and it worked as expected.

    I cannot see your data, but there are only three items for you to check:

    • Activites.id should match and be the same type as AssignItem.id (I assume numeric).
    • Activities.psa_tags needs to be Text (single or multiple)

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @broski1212 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard