I'm new to the world of Low Code app development, and so far I'm pulling my hair out.
I'm using a third party web app to submit JSON formatted data to Zapier via webhook, and then submit that to Backendless with codeless API that creates a record. I'm running into two issues that I can't figure out how to solve.
Backendless record creation with foreign key relationship. I'm creating a record in Table A, but that needs to have a relationship to Table B. I have it set up as such in Backendless, but in Zapier I don't see an option to populate the table_b_id in the Table A record I'm creating. What am I missing here?
After creating the Table A record, I want to create multiple records in Table C that are children of the Table A record. How on earth do I do this? With Python + SQL, I could do it in 2 minutes, but for the life of me I can't figure out how to do it the LowCode way using either Zapier or Backendless.
Any help would be appreciated! I'm totally stumped.
Backendless actions for Zapier let you save/update/delete an object in a single table. These are distinct API operations. Creating a relationship is a separate API call that doesn't have a corresponding action in Zapier's Backendless integration. However, you can create a relation between the object you're saving and a related "parent" (or "child") table using an API event handler in business logic. It can be done with Java, JS or Codeless. The event handler you'd be creating is afterSave.
You can save multiple objects with a single call using Codeless. The simplest way to do this by using the Bulk Create block: https://prnt.sc/x6cwp4. The objects connector should be a list of objects to save in the table.
Related
In my MS Access application the user opens the database to enter research notes (RNs). Each RN record needs to be attached to a project. All research notes entered during the current session relate to a specific project, which the user nominates on the first form. However, the RN - Project relationship is many-to-many. Although a single Project is attached when the RN record is created, other projects can be related later.
So... when I create and save a new RN record, I want to create a join table record with the new RN ID and the ID of the selected Project. I cannot find a way of creating this second record when creating the RN record. Does anyone have a way? Thanks
As June7th implied, It doesn't sound like you have ruled out the normal access forms/subforms approach. create a new database then insert the tables behind your many to many relationship. Then go to the database tools tab and tell access about the many to many relationship. For instance:
next select either of your main forms and then on the create tab select form and access will use the information about the relationships to auto-generate a rather ugly but working form and subform:
Form Prettification is Recommended before giving to actual users. Play around with the circled record selectors and try entering some data. Then check the tables and you will see that they have been properly updated. This approach may not work for your particular case, but try it because it is the easiest and fastest approach. Next approach is to add a button which associates a note and a project then runs some vba to add them to the junction table between notes and projects.
I am creating a web application using Strongloop using a MySQL database connector.
I want it to be possible, that a user can modify data in the application - but that this data will not be 'saved' until a user expressly chooses to save the data.
On the other hand, this is a web application and I don't want to keep the data in the user's session or local storage - I want this data to be immediately persisted so it can be recovered easily if the user loses their session.
To implement it I am thinking of doing the following, but I'm not sure if this is a good idea, or if there is a better way to be doing this.
This is one was I can implement it without doing too much customization on an existing relation:
add an new generated index as the primary key for the table
add a new generated index that represents the item in the row
this would be generated for new items, or set to an old item for edits
add a boolean attribute 'saved'
Data will be written as 'saved=false'. To 'save' the data, the row is marked saved and the old row is deleted. The old row can be looked up by it's key, the second attribute in the row.
The way I was thinking of implementing it is to create a base entity called Saveable. Then every Database entity that extends Saveable will also have the 'Saveable' property.
Saveable has:
A generated id number
A generated non id number - the key for the real object
A 'saved' attribute
I would then put a method in Savable.js to perform the save operation and expose it via the API, and a method to intercept new writes and store them as unsaved.
My question is - is this a reasonable way to achieve what I want?
I am almost done researching for my application. The last thing that I need to be able to learn how to do is the following situation: Let's say I have created a UItableview drilldown app, but once the user gets to the end of that drill down (their choices on a specific dog product for instance are now very specific), they can save that information. What I want my app to do here is, at the end of the drilldown, save their entire nsindexpath as another entity so that I can send this information later up to my MySQL database. My question is, how could I re-save an nsstring from an nsindexpath in another entity?
Start writing code instead of researching your entire app's architecture before you start it. You really only will learn from actually programming.
Use Core Data
Use tableView:didSelectRowAtIndexPath: to obtain the selected tableview cell's indexPath and store the indexPath or the data as needed.
I agree with runmads suggestions. CoreData will probably make your life easier in the long run. To answer your question though:
Don't save the table view's NSIndexPath. The selection index path is a view related property (in MVC terms). Your users choice belongs to the model domain. It's bad practice to mix the two and if you later insert new choices in one of your tables, your stored index paths will become invalid.
Instead create something like a UserChoice object or a dictionary or an array which you can pass down your tableview controllers as the user drills down. When the user selects a cell, add the primary key of the associated data object to your array. At the end, store the primary keys you've collected along the way into your database.
I need to load data into two objects. I am able to load data into one object using the data loader. The second object has a master-details relationship with the first object so I need to have the unique record id of the records of first object in the CSV file. How can I add those record id's to my CSV file?
You could download the "master" records after initial upload and perform some mapping similar to (Name -> Id). In Excel this could be achieved with VLOOKUP. Once you have generated new list of "detail" objects, there should be no problem uploading them. The mapping "ID->uploaded records" is also available in the success log file created by Apex Data Loader.
But the better way is to say loudly "screw the Salesforce ID, I don't need no stinking ID" :)
Think if your "master" has some unique field. It can even be the "ID" from your existing system from which you import to Salesforce. Create this field in Salesforce (if you didn't do it already) and mark it as "External ID". Afterwards you will be able to use this external ID instead of normal Salesforce ID as a way to make the link between source and target. In pseudocode:
with normal Salesforce ID you must
INSERT INTO detail_object (Name, SomeValue, master_ID) VALUES ("foo", "bar", [some valid salesforce id])
With external IDs you can have it easy and tell salesforce to do all the heavy lifting
INSERT INTO detail_object (Name, SomeValue, master_ID) VALUES ("foo", "bar", (SELECT Id from master_object where some_field_marked_as_external_id = "123")
Check out the Data Loader user guide for quick start and play with external ids if you can (in the free developer edition maybe?). It's easier to use than to describe it.
If you are using the Apex Data loader then you will have to do 3 things:
1: insert the master record(s). this will give them IDs
2: export those master records again including their IDs, and integrate that into your details data. A VLOOKUP is most useful for that sort of thing.
Or if there is only one master record, even easier, just copy the ID out of the URL and add it in on every detail record in your spreadsheet.
3: then insert the detail records with the master IDs
I've been battling this for a while. I'm trying to implement a many to one association. I have a bunch of rows in a table, called readings. These accumulate over time, and every now and then I want to export them. When I export them I want to create a new object called ExportEvent, to track which rows were exported, so they can be re-exported if need be. Therefore Reading has a nullable foreign key relationship with ExportEvent, as I create the readings before I export them.
What I'm finding is that when I then do the export, whether I first create the ExportEvent (evt) and add the readings using
evt.Readings.AddRange(),
or if I use
foreach(reading)
reading.ExportEvent = evt
When I call SubmitChanges I am always getting a new bunch of readings created with the association to evt, and the original records aren't updated.
I pared this back to its simplest though, just to see if I could create the two objects with no association, and I even found when I just retrieved all the readings and updated an int value on them, submitchanges still inserted a bunch of new records. What's going on?
Hmmm. Interesting - just clicked this link in my bookmarks, and found that the question has been resurrected, so will provide the (embarrassing) solution. All of my entities have audit data properties on them - CreatedDate and UpdatedDate. Therefore I've implemented the partial methods for the insert and update of each entity in the datacontext. I had copied and pasted (how often is this the cause of some downfall) some of these insert and update methods for the newly created entities. As a result I'd also copied an error, where the Update[blah] methods were calling ExecuteDynamicInsert, instead of ExecuteDynamicUpdate.
Suffice to say I was very frustrated when for 3 hours I'd been trying frantically to solve this problem, only to find it was due to a (silly) copy/paste error - and only to find the error about 3 mins after I'd posted this question!
Hope this helps someone.
I suspect it is because you are calling AddRange(). This will add the new objects to the data context. Instead, you should try just re attaching the existing objects by called Attach() on your data context.
(Or if you never detached them and still have your original data context, you don't need to do anything, just make the changes to the objects and call SubmitChanges())