Ask Method scripting

2.82K viewsScripting

Anyone have an example of a basic Ask method for prompting the model user to enter data? I am trying to find the best way to have the user enter a few pieces of information on a single prompt box that then populates fields in a matrix. For instance, the user puts the state they live in and their birthday. Two boxes in the same prompt then populate |Matrix::Test:1| and |Matrix::Test:2| for instance.

I don’t use scripting much beyond data updates so excuse the ignorance here. Appreciate any thoughts on this.


jklinghoffer Answered question December 2, 2020

Hi Jason,

I am not a scripting expert, but I think it should work for you:

def myMessage = “Enter your data”
def myInput = ask(myMessage, [“State”:String, “Birthday”:Date])

def st = myInput.get(“State”)
def bd = myInput.get(“Birthday”)

|Matrix1::State|.value = st

|Matrix1::Birthday|.value = bd

You will be able even to select a date from calendar. Just create a Matrix1 and add items State and Birthday and run this script.

jklinghoffer Posted new comment February 2, 2021

Thanks Tahir, this works great. Appreciate the answer!


Thanks Tahir, this is what I was looking for. Appreciate the answer!

jklinghoffer Answered question December 2, 2020

Latest Questions