?>

Integrate Basin with MongoDB Realm

Appy Pie Connect allows you to automate multiple workflows between Basin and MongoDB Realm

  • No code
  • No Credit Card
  • Lightning Fast Setup
20 Million man hours saved

Award Winning App Integration Platform

About Basin

Basin is a basic form backend that lets you collect data from submissions without writing a single line of code.

About MongoDB Realm

MongoDB Realm is a development platform designed for modern, data-driven applications. You can use Realm to build mobile, web, desktop, and IoT.

MongoDB Realm Integrations
MongoDB Realm Alternatives

Looking for the MongoDB Realm Alternatives? Here is the list of top MongoDB Realm Alternatives

  • MongoDB Integration MongoDB

Best Basin and MongoDB Realm Integrations

  • Basin Integration MongoDB Realm Integration

    Basin + MongoDB Realm

    Create User to MongoDB Realm from New Submission in Basin Read More...
    Close
    When this happens...
    Basin Integration New Submission
     
    Then do this...
    MongoDB Realm Integration Create User
  • Basin Integration MongoDB Realm Integration

    Basin + MongoDB Realm

    Create Service to MongoDB Realm from New Submission in Basin Read More...
    Close
    When this happens...
    Basin Integration New Submission
     
    Then do this...
    MongoDB Realm Integration Create Service
  • Basin Integration MongoDB Realm Integration

    Basin + MongoDB Realm

    Confirm Pending User in MongoDB Realm when New Submission is created in Basin Read More...
    Close
    When this happens...
    Basin Integration New Submission
     
    Then do this...
    MongoDB Realm Integration Confirm Pending User
  • Basin Integration MongoDB Realm Integration

    Basin + MongoDB Realm

    Delete Trigger in MongoDB Realm when New Submission is created in Basin Read More...
    Close
    When this happens...
    Basin Integration New Submission
     
    Then do this...
    MongoDB Realm Integration Delete Trigger
  • Basin Integration MongoDB Realm Integration

    Basin + MongoDB Realm

    Enable User in MongoDB Realm when New Submission is created in Basin Read More...
    Close
    When this happens...
    Basin Integration New Submission
     
    Then do this...
    MongoDB Realm Integration Enable User
  • Basin Integration {{item.actionAppName}} Integration

    Basin + {{item.actionAppName}}

    {{item.message}} Read More...
    Close
    When this happens...
    {{item.triggerAppName}} Integration {{item.triggerTitle}}
     
    Then do this...
    {{item.actionAppName}} Integration {{item.actionTitle}}
Connect Basin + MongoDB Realm in easier way

It's easy to connect Basin + MongoDB Realm without coding knowledge. Start creating your own business flow.

    Triggers
  • New Submission

    Triggers when a user submits to your form.

  • New Push notification

    Triggers when a new push notification is created

  • New Service

    Triggers when a new service is created

  • New User

    Triggers when a new user is created

    Actions
  • Confirm Pending User

    Confirm a pending user

  • Create Service

    Create a service

  • Create Trigger

    Creates a Trigger

  • Create User

    Creates a User

  • Delete Push Notification

    Delete a pus notification

  • Delete Trigger

    Delete a trigger

  • Delete User

    Delete a User

  • Disable User

    Disable a User

  • Enable User

    Enable a User

  • Update Trigger

    Update a trigger

Compliance Certifications and Memberships

Highly rated by thousands of customers all over the world

We’ve been featured on

featuredon
Page reviewed by: Abhinav Girdhar  | Last Updated on July 01, 2022 5:55 am

How Basin & MongoDB Realm Integrations Work

  1. Step 1: Choose Basin as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick MongoDB Realm as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from Basin to MongoDB Realm.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of Basin and MongoDB Realm

Basin is a simple and powerful spution for managing structured data. It handles things like schema management, versioning, data validation, and documentation out of the box. Basin has a very nice API that makes it easy to use with other services such as MongoDB Realm. In this blog post, I will describe how to integrate Basin and MongoDB Realm in an Android application.

The way to integrate the two services is by using Realm’s Java connector. As stated previously, Realm is a mobile database that enables us to store objects locally on the device so we can access them later even if our internet connection is lost. The benefit of this is that we will be able to access our data even when there is no network connectivity. We can either connect our Realm Object Server via HTTP or over WebSockets, so for this example, I will be using HTTP.

So let’s start by creating a Java project and add the Realm library to it. We can do this by adding the fplowing line of code into your build.gradle file in the dependencies section:

buildscript { repositories { google(. jcenter(. } dependencies { classpath 'com.android.tops.build:gradle:3.2.1' classpath 'io.realm:realm-gradle-plugin:4.6.1' } }

Next, we will create a RealmObject that represents our model class:

public class Customer extends RealmObject { @PrimaryKey private String id; private String firstName; private String lastName; private String emailAddress; // getters and setters }

We also need to create a RealmConfiguration class to define all of our Realm variables (like the Realm object name. We can do this by creating an instance of RealmConfiguration and then adding it to the main class by adding this line of code to the main activity:

RealmConfiguration realmConfig = new RealmConfiguration.Builder(context. .name("customer". .deleteRealmIfMigrationNeeded(. .schemaVersion(1. .build(); Realm.setDefaultConfiguration(realmConfig);

Let’s take a closer look at the code above:

RealmConfiguration realmConfig = new RealmConfiguration.Builder(context. .name("customer". .deleteRealmIfMigrationNeeded(. .schemaVersion(1. .build();

This creates a new RealmConfiguration object and sets the name of our Realm object (which in this case is “customer”. We need to make sure that we have a deleteRealmIfMigrationNeeded set to true otherwise our database won’t be cleared when we update the schema version (which is what happens when we call persist(. . In our case, every time we change our schema version, we will want to clear all existing data in our database. Finally, we set the schema version to 1 so that we don’t delete anything from our database if we decide to update the schema version from 1 to 2 for example. The next thing we need to add is an initialization method where we will initialize our Realm database:

private static void initRealm(. { if (!realm.isInitialized(). { realm = Realm.getDefaultInstance(); realm.executeTransactionAsync(new Realm.Transaction(. { @Override public void execute(Realm realm. { try { realm.copyFrom(realmConfig); } catch (Exception e. { e.printStackTrace(); } } }); } }

In the code above, we check if our realm database is initialized or not and if it isn’t then we call copyFrom(. which copies the information from the configuration object that we created earlier into our local Realm database. Let’s now create an Activity that will display all records from our database (if there are any. This is done by creating an instance of ViewPager with FragmentPagerAdapter as its adapter:

private final LayoutInflater inflater = LayoutInflater.from(MainActivity.this); private final FragmentPagerAdapter pagerAdapter = new FragmentPagerAdapter(getSupportFragmentManager()); private final ViewPager viewPager; @Override protected void onCreate(Bundle savedInstanceState. { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); viewPager = findViewById(R.id.viewpager); viewPager.setAdapter(pagerAdapter); viewPager.setOffscreenPageLimit(2); pagerAdapter.setCurrentItem(0); initRealm(); } @Override public bopean onCreateOptionsMenu(Menu menu. { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater(.inflate(R.menu.menu_main, menu); return true; } @Override public bopean onOptionsItemSelected(MenuItem item. { int id = item.getItemId(); switch (id. { case R.id.action_settings. return true; default. return super.onOptionsItemSelected(item); } } @SuppressWarnings("StatementWithEmptyBody". private void initRealm(. { if (!realm.isInitialized(). { realm = Realm.getDefaultInstance(); realm.executeTransactionAsync(new Realm.Transaction(. { @Override public void execute(Realm realm. { try { realm.copyFrom(realmConfig); } catch (Exception e. { e.printStackTrace(); } } }); } }

The process to integrate Basin and MongoDB Realm may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.