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: 
marco_puccetti
Partner - Creator
Partner - Creator

Peek in TextBox

Hello, when i try to use this function: =peek('PRODOTTO', 1,'FATTI') in a TextBox or in a Variable, the sintax checker return error.

Is there anything i have done wrong?

PRODOTTO is the field, 1 is the record and FATTI is the table.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

What happens when you put =m_Prod (without the $ and parenthesis) in a text object?

View solution in original post

17 Replies
prma7799
Master III
Master III

I think we can not write peek function in text box.

tresesco
MVP
MVP

Peek() is a script function.

mukesh24
Partner - Creator III
Partner - Creator III

Peek() is inter record function & it is use in back end scripting

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

As said above Peek function is a script function can't be used in UI. However, if you explain what you want to achieve may be someone might point you in right path.

If you are just debugging and wanting to know what the peek function (variable) would return. Then insert EXIT SCRIPT after the peek, reload and go to UI put the variable in a Text box. Dollar sign expand it

sunny_talwar

If you want the first record from the that field name, you can try something like this:

=SubField(Concat(DISTINCT PRODOTTO, '|'), '|', 1)

The only issue is that the Concat will do a ascending order concatenation and instead of getting the very first entry from that table, you will get first value in the ascending order. To fix this you will have to add a column in your script which would be something like this:

FATTI:

LOAD PRODOTTO,

          RowNo() as ID

          and so on...

FROM XYZ;

and then use this expression:

=SubField(Concat(DISTINCT PRODOTTO, '|', ID), '|', 1)

Now you concat function will be based on the ID field and your SubField will give you the very first entry from your PRODOTTO field.

HTH

Best,

S

Not applicable

Hi Marco,

Try this let function in scripting and then use variable in text box.

FATTI:

Load

      Sum(PRODOTTO)    as     PRODOTTO

resident main_table;

Let variable=peek('PRODOTTO', 0,'FATTI')

Thanks ,

krish

nikhilgarg
Specialist II
Specialist II

Hey,

Peek function is not supported in Textbox then how have you used it in textbox. You  may tell the description of task you want to do then only any of us may help you.

thanks

anbu1984
Master III
Master III

Try FieldValue() like below in Text box

=FieldValue('PRODOTTO',1)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

anbu's suggestion is correct, providing PRODOTTO is not a key field (ie present in more than one table in the table viewer.

If PRODOTTO is a key field, you will need to do something in the load script to mark the record with a flag field, or Peek() it into a variable which you can then use in your expression. This also works if it is not a key field.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein