Business Forms : read only

Hello everyone,

I’m facing some issues with the “read only” type of element in the Business Forms.

As you can see below, the element “ID” is set as a “read only” type and linked o a query.

So I’m supposed to see the value of “ID” on the panel, but there is only a grey rectangle and nothing else is shown as showed below.

image

Can someone explain why it’s doing that or what I’m doing wrong ?

Hi LeaneM,

when you configured a field as Read-only.
You have to fill it in the “Initial Fields” section.
That does the trick.

Jo

Hi joachimschiewek,

I appreciate your help, I noticed you had posted a similar issue some years ago.

What exactly should be detailed in the “Initial Fields” ?

I don’t get what type or what kind of writing is expected.

Thanks in advance !

Leane

If you have selected the query as the source, then in your case the result of query “A” from the “id” column must be in the Value Fields field. So, Value Field:A:id
Thats what you have done.

Now you will also find the field “ID” created in this way under the tab “Initial Fields - Query Fields”. The query field “A:ID” is now there.

Select the result of the query again, i.e. A:id.
The value should then appear in gray in the form field ID.

Jo

1 Like

https://volkovlabs.io/plugins/business-forms/elements/read-only/

Okay so I got your explanation. The field “ID” is created under the tab “Initial Fields” as you explained.

So I specified the name as you can see in the image below, as I couldn’t select anything.

Now the issue persist as noting is shown…

You may have other infos or ideas, feel free to share and thanks in advance !

Leane

…does the “Table View” display the result of your query? (Query A)

image

and wich version of the BusinessForms Plugin do you have installed?
there was an error in an older version.

Yes, the “Table View” does display the value of my query as shown below.

The version of the Business Forms plugin is 4.7.0, what do you think ?

hmm… I have absolutely no idea.
I use version 4.9
And the Initial Fiels is showen as:

but it can’t be that… I’m at a loss, so sorry

Thanks already for your help since the start !!

I will make sure to have a more recent version then and try again what you explained earlier.

I found the root of this issue, under the tab “Initial Request” and by “Initial Action” I had chosen something else than “Query” which is necessary to be able to select the query for each element !!!

It works better haha, now I need to dig into how to write the request to update my database.

1 Like

@LeaneM Let us know if something is not clear in the documentation for the Business Forms panel, we constantly improving it based on the Community feedback.

1 Like

We finaly found it in the end… :sweat_smile: :+1:

Remember, if you have read-only elements, you have to select “All Elements” for the Update Request Payload - Request Payload. Then you can use the Read-Only-Element in the update query.

Jo

Hi @mikhailvolkov well for the “Update Request” part on the documentation, I’m having some trouble to understand exactly what is needed.

I tried something as you can see below. I underlined in green the database name and in pink the name of the table.

The goal here is to update the value of “NOM” in the table by entering a value to the variable “NOM1” thanks to the Business Forms.

I’m acually lost at what to specify at the “Update Request”.

In addition to this an error is showing :
image

If you could help me finding what is wrong or what needs to be added, it would be gladly appreciated.

Thank you for reminding me !!

By doing this where do I write the code to update the table ?

Leane

As I wrote…

when you use a READ-Only_Element as Variable you have to chose “All Elements”

You don’t need to change anything in the “Create Payload” section.

You can write your Query in the “Query Editor” section in normal way.

Example

Hope that helps you

My apologies, I didn’t quite follow your insrtuctions, will do now !

So after specifying the “All Elements” and not changing anything to the “Create Payload” section, I then wrote in the query editor what I want to do, as you can see on the image below.

I can achieve to write on a table of my database, however it writes "${payload.NOM1} instead of the name of the variable “NOM1” specified by the user in the Business Forms …

image

Do you have any idea of where the issue comes from ?

Ok…
you have a Form Element with Id: “NOM1” ?

and it is filled with a value?

Are you able to check in the Browser development tool which rawSql is in the payload?

1 Like

Yes I do, and you don’t have to search no more :slightly_smiling_face:

It was a silly mistake that I made while writing the MySQL request…

I can now achieve to update the table I want with the value I enter in the Business Forms.

Thank you again !! You will probably see me around haha !

1 Like