Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select the field values based on given number

Hello,

I've a field with data as:

ID

10

7

5

3

2

1

- In inputbox(i.e. Last n ID's)  i'll take the values as: ALL;1;2;3;4;5;6;7;8;9;100;500;1000;

- Now the count of the ID is 6.

- If i select 1 in the input box the field ID should show with selection 10 only. If i select 2 it should select 10,7. if select 3 it should select 10,7,5.

- If i select ALL or 6(i.e b'coz 6 is equal to ALL) it should select all values of the field.

If possible can you give solution with button action.

How can i achive this can anyone help me.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi Jacq.

if you referring to the load order as the order you want to use for the number of IDs to select in a listbox, try attached sample with this expression:

=if(vNum='ALL','*','('&concat(FieldValue('ID',ValueLoop(1,$(vNum))),'|')&')' )

Otherwise you need to load your field in the appropriate order first.

Regards,

Stefan

View solution in original post

6 Replies
swuehl
MVP
MVP

Hi Jacq.

if you referring to the load order as the order you want to use for the number of IDs to select in a listbox, try attached sample with this expression:

=if(vNum='ALL','*','('&concat(FieldValue('ID',ValueLoop(1,$(vNum))),'|')&')' )

Otherwise you need to load your field in the appropriate order first.

Regards,

Stefan

Not applicable
Author

Tnx swuehl it's working.

one more  think i want.. How can i put constraint for this inputbox according below example logic.

For eg:

LOAD * INLINE [

ID, A

10,1

7,2

5,3

3,4

2,5

1,6

];

In frontend i'll select 1,2,3 values of A, then the count of ID is 3. When we select the value of the variable (i.e. inputbox) as 4 it should show the error message if it is ALL then fine(doen't requried error message).

- If the variable value is empty it show the error message.

- Without selecting the values of A. If he select ALL fine. But if he select more than the count of ID it should show the error message.

- one more think is after keeping the constraint. I'll take one button to reset the value of the variable to ALL. When i click the button the variable value should be ALL.

Not applicable
Author

I tried below constraint..

=if(len(GetFieldSelections(A))>0,

if($(vNum)='ALL','',$<= (count(distinct ID))),

if($(vNum)='ALL','',$<= (count(distinct ID))))

It is working little bit only. With above query i'm not able to select ALL and reset the value of the varaible to ALL with button action.

swuehl
MVP
MVP

$(vNum) should probably reference the value to be checked, right?

=if(len(GetFieldSelections(A))>0,    if( $='ALL','',$<= (count(distinct ID))),    if( $='ALL','',$<= (count(distinct ID))))

Not applicable
Author

Tnx a lot... last help i need from you.

If the variable empty it should show the error message...

swuehl
MVP
MVP

Maybe like this:

=if(len($)>0,

if(len(GetFieldSelections(A))>0,    if( $='ALL','',$<= (count(distinct ID))),    if( $='ALL','',$<= (count(distinct ID)))),

FALSE())

as constraint, then check error message and put in a text.