How to train Azure Form Recognizer to recognize a optional field? - artificial-intelligence

I'm trying to train a model, but, one field of my dataset is optional. When analyzing the document, the model doesnt return the expected result.
the blue field represents the field that I'm trying to map. In document 1, it is not present, so, the return should be empty.
in document 2, the field is present and the model is able to retrieve the data.
when the value is not present, the model maps to another random field, for example "Nome Fantasia", instead of return empty.
how can I tell Azure Form Recognizer that the field may or may not be present?
or, second question, how can I inform model that the value is aways below "Data de fim da sanção" label?

Related

Rename salesforce columns from API_name to field label

When you use salesforce data that has being exported through any API, tables you get have column names in their "API_Name" format. This differs a bit from their "Filed Label" format in which they are presented on salesforce's web UI (for example on reports).
You can find what API name corresponds to any of the columns (objects) in the salesforce object manager.
My question is: is there anywhere a dictionary to map API Names back to their Filed Labels? It will be very helpful to have in JSON or anything that can be used programmatically.
It's called "describe" data. It's available for whole object (label, plural label), fields (label, picklist value translations), names of related lists.
In Apex this is a good initial reading: https://developer.salesforce.com/docs/atlas.en-us.200.0.apexcode.meta/apexcode/apex_dynamic_describe_objects_understanding.htm and for fields: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_fields_describe.htm
If you're using REST API - make GET to /services/data/v55.0/sobjects/Account/describe for example.
Have a look at https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_quick_start.htm too. For example if you need to build your own UI for "dependent picklists" it can be painful to read it all from "describe", https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_features_records_dependent_picklist.htm is bit better. And when you fetch records via this API you get fields as object with visible label and raw value (useful when displaying dates, numbers for example)

Redux form set custom error message based on field's hinttext in Field Validation

I am trying to write a Field validation so that i don't have to write separate validation in every file. While trying to do it, i am able to get value of the field as well as the whole form fields.
I have to set the error message based on the field name, eg.
For field name as Firstname the error message has to be : First name is invalid.
is there a way to implement this with the Field Validation, or the sync validation is the only way?
Any help will be appreciated.
There is a "hacky" way to do this. Since in field validation you get field value and form values as parameters, you could get field name (which would be the key of the form values object) by searching for a matching value in form values. Then you would need to have a file with field name translations where you could get the field name, e.g. translations[fieldName].
However, since the above way requires more setup and sync validation is relatively simple, I would recommend using sync validation.

How do I get the SalesForce record id in a custom field

I wanted to add a simple read-only URL-field to 'opportunities' in SalesForce that contains a link to an external webpage with the 15-char record id (used in the salesforce urls) attached to it . To do this I wen to /ui/setup/Setup?setupid=Opportunity --> fields and created a new field under 'Opportunity Custom Fields & Relationships'.
I chose a field with data type 'URL' and added a default value. I thought
"http://example.com/?sfid="&id would do the trick, but this returns
Error: Field id may not be used in this type of formula
This is a vague error. Is my syntax of a default value wrong, or am i using the 'id' parameter in a wrong way? And what is the right way to do this?
I'm new to SalesForce, as you probably already have guessed.
As the other answer stated - Id will be known only after insert meaning the "default value" trick won't work for you.
You have some other options though:
Workflow rule that would be populating the URL field after save.
Formula field of type text that uses HYPERLINK function
HYPERLINK("http://example.com/?sfid=" & Id , "See " & Name & " in ext. system")
Custom link (similar to custom buttons, they appear on the bottom of the page layout. Search them in online help)
The difference between 2 and 3 is quite minor. Custom links can appear only on the record's detail view while formula fields & other urls are well... fields - so they can be used in reports, listviews etc.
You'd have to decide which version suits you best.
This is a great question. You're right, the error is very vague.
To begin with, read some of the documentation on default fields. Pay particular attention to the order of operations:
The user chooses to create a new record.
Default field value is executed.
Salesforce displays the edit page with the default field value pre-populated.
The user enters the fields for the new record.
The user saves the new record.
Default field values are calculated before any other record data including the id are available. For this reason, they cannot be calculated based on other record fields. Especially the record id, which has not yet been assigned.
To get this functionality, you will need to create a workflow rule that fires on record creation and inserts the proper value into your field.
It would be nice if we could have formula URL fields, but we don't. EDIT: I am dumb and forgot about using HYPERLINK in text formula fields, as eyescream correctly points out.

How do I display an input field for Users, in a visualforce page?

I simply want to display an input field, that will let me capture a user, so I can filter a list from a custom object by owner. CustomObject__c.OwnerId is not writable, so when I bind it to an input field, nothing is displayed on my page! I don't want to have a drop down list of users (There could be hundreds!) and I don't want to create a spurious custom object with a writeable field, related to the User object. How can I get the input field functionality for a read only field, as if it were writeable?
OwnerId field should be writeable. Unless your field security permissions are messed up or for example the field is hidden because it's a detail in Master-Detail relationship.
But when you'll manage to get it to work you'll see that most likely it's a bit weird lookup that can point to User or Queue.
If you're fine with that - great, just check the security around the field. If you need really only a lookup to user - check if you have any custom Lookup(User) field? You could create a dummy record of that type in the controller and don't do any DML with it, just use the fact it'll have the lookup.
If you don't have any custom ones - I think that Account / Contact / Opportunity owner must be a user (can't have queues). You might have to force <apex:input field... required="false"/> but other than that it should OK?

Populating a field in wpf

I have a database of finance info and i want to check that supplied totals 'add up'. I have added fields to the database for the check data and am using data binding via the Entity Framework. How do i populate these 'check' fields while the user is adding data to the record?
Eg The form contains SubtotalA, SubtotalB and TotalAB textboxes. The database has these fields plus CheckTotalAB. The user keys in SubtotalA, SubtotalB and TotalAB from a hard copy form. I want to populate CheckTotalAB with the sum of SubtotalA and SubtotalB to compare against the provided TotalAB.
I first tried getting the data from the textboxes. Unfortunately txtSubtotalA.Value doesn't exist.
I then thought I'd have to go to the entity itself. Unfortunately I don't know how to access the current record/entity being entered and if I did, how would I access the value of fields that haven't been saved yet.
Can someone point me in the right direction?
tia
mcalex
Accessing the entity was the answer. This was accomplished through use of an entity property in the datacontext that i set to equal a class member i added to my form class.
After that getting to the entity's fields including my calculated fields was just a case of getting/setting the member's properties.

Resources