Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field called CitiesWithFactory. It contains cities that have cars in the factory of the city.
for example I have New York, London and Berlin, if Berlin doesn't have any cars at the moment the field would look like this:
CitiesWithFactory: New York, London
I have a button for each city which I want to disable if there are no cars in it.
How do I check if the field contains the city?
Maybe like
=Count({1<CitiesWithFactory *= {'Berlin'} >} CitiesWithFactory) >0
you can use function FindOneOf
for each button you can define
if (FindOneOf(CitiesWithFactory,'Berlin')>0 if Berlin is in List it Returns the Position of the text, otherwise 0
you can use conditional layout to Show or hide button
I think it could be helpful if you splitted this field within the script, for example with a subfield-function like:
table:
Load
ID, /* relation to other tables probably per datefield and others*/
subfield(CitiesWithFactory, ',') as CitiesWithFactory,
SomeOtherFields
From xyz;
Often it's easier to use normal fields and not such combined values which it make only difficult without any further value.
- Marcus
Actually that's what I assumed - that your field CitiesWithFactory has several values, one for each city, not a single concatenated value.
Both versions should be supported by
=WildMatch( Concat(DISTINCT CitiesWithFactory, ', '), '*Berlin*') >0