Hi,
I have this formula on button:
ClearCollect(
ToUpdateCollection,
Filter(
'WELDER LOG REGISTER',
'Joint Number' = ThisItem.'Joint Number',
'Production Order Induk' = ProdInduk.Text
)
);
ForAll(
ToUpdateCollection,
Patch(
'WELDER LOG REGISTER',
ThisRecord,
{'Repair by': Welder.SelectedItems}
)
)
But, when I click button, previous value in 'Repair by' will be replace to the new one. I want, when I click, the new value will be appear side by side with the previous value.
Repair by is choice column type (can multiple choice). How to do it? Thankyou!
Here's how to correct the formula:
Firstly, ensure that Welder.SelectedItems actually contains the text values you want to append. If Welder.SelectedItems is a table with a column named, for instance, Value, which holds the choice values, you would need to convert this to a text string.
The corrected formula should look like this:
ForAll(
ToUpdateCollection,
Patch(
'WELDER LOG REGISTER',
ThisRecord,
{
'Repair by': Concat(ThisRecord.'Repair by', Value & ";") & Concat(Welder.SelectedItems, Value & ";")
}
)
)
In this formula, Concat function is used instead of Concatenate. Concat takes a table and a formula and returns a text result where the formula has been evaluated for each record in the table, and the results are concatenated together.
This should append the values from Welder.SelectedItems to the existing 'Repair by' field as a text string, with each value separated by a semicolon. Adjust the column name Value to the actual column name from Welder.SelectedItems that contains the choice values you want to append.
@firda59 ,
It seems there might have been a misunderstanding with the previous formula. The Concatenate function should merge text values, not Choice fields directly. You need to ensure that you're manipulating the text of the selected items, not the Choice field objects themselves. Here's a revised approach:
For example, assuming Welder.SelectedItems returns a table of records with a text field, you might need something like this:
ForAll( ToUpdateCollection, Patch( 'WELDER LOG REGISTER', ThisRecord, {'Repair by': ThisRecord.'Repair by' & "; " & Concat(Welder.SelectedItems, Value & ";")} ) )
In this formula, Concat is used to create a string of all the selected items' values, separated by semicolons, which are then appended to the existing 'Repair by' value.
Remember to replace Value with the actual name of the field in the Welder.SelectedItems that holds the text you want to append.
This approach should append the new selections to the existing 'Repair by' field content, separated by semicolons. Make sure to test the formula and adjust the field names according to your actual data schema.
Hi @firda59 ,
To modify your PowerApps formula so that the new 'Repair by' value appears alongside the previous value in a choice column, you need to concatenate the existing values with the new selection. Your updated formula should look something like this:
ForAll(
ToUpdateCollection,
Patch(
'WELDER LOG REGISTER',
ThisRecord,
{'Repair by': Concatenate(ThisRecord.'Repair by', ";", Welder.SelectedItems)}
)
)
In this revised formula, `Concatenate` is used to join the existing 'Repair by' values with the new selection from `Welder.SelectedItems`. The semicolon (";") is a typical delimiter for separating items in a string, but you should adjust it based on how your choice column manages multiple values. This will ensure that when you click the button, the new value is added next to the existing ones, rather than replacing them.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.