UserResponse() is a report level function. You’ll have to use @prompt() at the universe level. And keep all the prompt texts exactly the same to have the prompt appearing only once.
Prompts cannot currently depend on previous prompts. All prompts are displayed together, and can be answered in any order.
If you want to change values based on a previous prompt answer, you have to use Cascading Prompts which are created in the universe. The typical example is to prompt for a state, then get a list of cities that belong to the selected state, and finally get a location from the list of locations within that city.
If you can provide specific requirements for what you are trying to do (rather than the generic examples provided so far) you might get better help.
All prompts will be executed, the trick is to make them do what you want.
Here is a prompt definition that will allow the user to pick Add or Delete from a list:
@prompt('Add or Delete?','A',{'Add','Delete'},mono,constrained)
Now take that prompt and embed it in a case statement for the actual condition.
case @prompt('Add or Delete?','A',{'Add','Delete'},mono,constrained)
when 'Add' then table.add_date
when 'Delete' then table.delete_date
end
between
@prompt('Enter begin date','D',,mono,free)
and
@prompt('Enter end date','D',,mono,free)
But, i cant test my universe now as i already got my QA sign-off and i dont want to play with it till the end of this week.
I will test this on monday.
can you please tell me one more thing (may be this wil make me look dumb, but)
should the code be an object in my universe? or a condition?
If it is an object, will it ask me for prompts, even if i put the object in the select panel, and not in the condition panel in the query panel.