No problem @Fran_Vidicek !
I’m very glad to know you were able to make it work !
It was the very first thing I tried before saying that I was getting back
(as it seemed like a shorter and easy way to get to a possible solution)
I’ll admit that this thought crossed my mind but I wasn’t sure you would need it (and I then got distracted IRL and forgot to test this as well… Sorry about that ) .
So, just for completeness (in case someone else would need something similar), here’s a button allowing you to remove multiple erroneous currencies for a country (See [Submit edits - 2]
in the sample)
The workflow is :
- Click on the
Edit Country
button in the tableCountry
for the country having erroneous currencies tied to it.
The button will add a row in the helper table below - In the helper table, select the currencies you want to remove for the selected country (leaving out the correct one)
- Click on
Submit
([Submit edits - 2
] or[Submit edits - 3]
)
The whole Action Formula
in [Submit edits - 2
] is :
Currencies.Filter(
Currency.Contains(thisRow.[Select currencies - The ones to remove].Currency)
).ForEach(
RunActions(
ModifyRows(
CurrentValue,
Country,
Splice(
CurrentValue.Country,
CurrentValue.Country.Find(thisRow.[Country being edited]),
1
)
)
)
)
And similarly to my previous reply, what it does is :
Step 1 : Filter()
Currencies.Filter(
Currency.Contains(thisRow.[Select currencies - The ones to remove].Currency)
)
[...]
So we take the table Currencies
and we ask the filter to look for and keep the rows where CurrentValue.Currency
contains the Currency
of thisRow.[Select currencies - The ones to remove]
(i.e.: the erroneous currencies)
This returns a list of rows from the table Currencies
Now that we have the appropriate list of rows, the Step 2 is :
[...].ForEach(
RunActions(
ModifyRows(
CurrentValue,
Country,
Splice(
CurrentValue.Country,
CurrentValue.Country.Find(thisRow.[Country being edited]),
1
)
)
)
)
… For each row returned by the filter and stored within CurrentValue
, ModifyRows()
:
-
The
row
to modify isCurrentValue
-
The
column
isCurrentValue.Country
I.e.: The fieldCountry
in the tableCurrencies
for that specific row -
The
columnValue
is the spliced list of Countries for that specific rowSplice()
:-
The
value
isCurrentValue.Country
I.e.: The current list of countries in the fieldCountry
in the tableCurrencies
for that specific row ( stored withinCurrentValue
) -
the
start
isCurrentValue.Country.Find(thisRow.[Country being edited])
I.e.: The position ofthisRow.[Country being edited]
in the current list of countries for that specific row -
the
deleteCount
is still 1
(For 1 currency inthisRow.[Select currencies - The ones to remove]
we remove 1 country fromthisRow.[Country being edited]
, 1 by 1 in this case )
-
And the button [Submit edits - 3]
still uses the fields next to it to get to the same result